'use strict';
var Model = require('../../../Base/server/controllers/Model');

var modelField = {};
modelField.Code = {
    type: String,
    trim: true,
    Name: '编码',
    IsUnique: true,
    IsEmpty: false
};
modelField.Name = {
    type: String,
    Name: '名称',
    IsEmpty: false,
    trim: true
};
modelField.Value = {
    type: String
};
modelField.IsDisplay = {
    type: Boolean,
    Name: '显示'
};
modelField.Enabled = {
    type: Boolean,
    Name: '可编辑'
};
modelField.IsEmpty = {
    type: Boolean,
    Name: '可空'
};
modelField.Classification = {
    type: String,
    Name: '模块标识'
};
//字段类型
modelField.Type = {
    type: Number
};
//备注
modelField.Remark = {
    type: String
};
//枚举编码，下拉控件使用
modelField.EnumCode = {
    type: String
};
//日期类型，日期类型使用
modelField.CalendarType = {
    type: Number
};
//实体ID，参照使用
modelField.Key = {
    type: String
};
//显示值，参照使用
modelField.Text = {
    type: String
};
//绑定Key，参照使用
modelField.KeyField = {
    type: String
};
//绑定Value，参照使用
modelField.CodeField = {
    type: String
};
//绑定显示值，参照使用
modelField.TextField = {
    type: String
};
//实体名称，参照使用
modelField.EntityName = {
    type: String
};
//参照弹出框口的显示标题，参照使用
modelField.WindowTitle = {
    type: String
};
//查询条件，参照使用
modelField.Condition = {
    type: String
};
//排序条件，参照使用
modelField.OrderBy = {
    type: String
};
//关联条件，参照使用
modelField.Populate = {
    type: String
};
//显示列集合，参照使用
//[{FiledName: 'Parent.Name',DiplayName: '主菜单',Width: '100px'}]
modelField.DisplayColumns = {
    type: String
};

var newModel = new Model(modelField);
newModel.addIndex({Classification: 1, Code: 1}, {"unique": true});
newModel.create('Parameter', '系统参数');
